package com.ishansong.ticket.service;

import com.ishansong.ticket.exception.ServiceDaoException;
import com.ishansong.ticket.exception.ServiceException;
import com.ishansong.ticket.model.Ticket;

import java.util.List;

public interface TicketService {

	/**
	 * 
	 * @param id  id
	 * @return Ticket
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	Ticket getTicket(Long id) throws ServiceDaoException, ServiceException;

	/**
	 *
	 * @param ticket 工单
	 * @return Long
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	Long saveTicket(Ticket ticket) throws ServiceDaoException, ServiceException;

	/**
	 *
	 * @param ticket 工单
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	void updateTicket(Ticket ticket) throws ServiceDaoException, ServiceException;

    /**
     *
     * @param id id
     * @return Boolean
     * @throws ServiceDaoException
     * @throws ServiceException
     */
	Boolean deleteTicket(Long id) throws ServiceDaoException, ServiceException;

	/**
	 * 根据订单号获取工单数量
	 * @param orderNumber 订单号
	 * @return int
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
    int queryTicketCountByOrderNumber(String orderNumber) throws ServiceDaoException, ServiceException;

	/**
	 * 根据订单号获取工单
	 * @param orderNumber 订单号
	 * @return List<Ticket>
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	List<Ticket> queryTicketByOrderNumber(String orderNumber) throws ServiceDaoException, ServiceException;

	/**
	 * 工单列表
	 * @param status 状态
	 * @return List<Ticket>
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	List<Ticket> queryTicketPageByStatus(Integer status,int page,int pageSize, String operatorId) throws ServiceDaoException, ServiceException;

	/**
	 * 获取工单分页数据
	 * @param status 状态
	 * @return int
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	int queryTicketCountByStatus(Integer status,String operatorId) throws ServiceDaoException, ServiceException;

	/**
	 * 根据电话号查询
	 * @param mobile 电话号
	 * @return List<Ticket>
	 * @throws ServiceDaoException
	 * @throws ServiceException
	 */
	List<Ticket> queryTicketByMobile(String mobile) throws ServiceDaoException, ServiceException;


}
